<%@ Page Language="C#" AutoEventWireup="true" CodeFile="menu.aspx.cs" Inherits="menu" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <link href="css/admin.css" type="text/css" rel="stylesheet">
    <script language="javascript">
        function expand(el) {
            childObj = document.getElementById("child" + el);

            if (childObj.style.display == 'none') {
                childObj.style.display = 'block';
            }
            else {
                childObj.style.display = 'none';
            }
            return;
        }
    </script>
</head>
<body>
    <table height="100%" cellspacing="0" cellpadding="0" width="170" background="images/menu_bg.jpg"
        border="0">
        <tr>
            <td valign="top" align="middle">
                <table cellspacing="0" cellpadding="0" width="100%" border="0">
                    <tr>
                        <td height="10">
                        </td>
                    </tr>
                </table>
                <%
                    var temp = Lst.Where(x => x.Pid == "0").ToList();
                    for (int i = 0; i < temp.Count; i++)
                    {

                        Response.Write(" <TABLE cellSpacing=0 cellPadding=0 width=150 border=0>" + Environment.NewLine);
                        Response.Write("<TR height=22>" + Environment.NewLine);
                        Response.Write("<TD style=\"PADDING-LEFT: 30px\" background=images/menu_bt.jpg><A " + Environment.NewLine);
                        Response.Write("   class=menuParent onclick=expand(" + (i + 1).ToString() + ")" + Environment.NewLine);
                        Response.Write("   href=\"javascript:void(0);\">" + temp[i].Name + "</A></TD></TR>" + Environment.NewLine);
                        Response.Write("   <TR height=4>" + Environment.NewLine);
                        Response.Write("<TD></TD></TR></TABLE>" + Environment.NewLine);


                        Response.Write("<TABLE id=child" + (i + 1).ToString() + " style=\"DISPLAY: none\" cellSpacing=0 cellPadding=0 width=150 border=0>" + Environment.NewLine);

                        var plst = Lst.Where(x => x.Pid == temp[i].Id).ToList();
                        for (int j = 0; j < plst.Count; j++)
                        {
                            Response.Write("<TR height=20>" + Environment.NewLine);
                            Response.Write(" <TD align=middle width=30><IMG height=9 src=\"images/menu_icon.gif\" width=9></TD> " +
                                "  <TD><A class=menuChild  href=\"" + plst[j].Url + "\"  target=main>" + plst[j].Name + "</A></TD>");
                            Response.Write("</TR>" + Environment.NewLine);
                        }

                        Response.Write("</TABLE>" + Environment.NewLine);
                    }
                %>
</body>
</html>
